{% set reviews = data('LatestCourseReviews',{'count':config.count}) %}

<div class="es-box comment">
	<h2>{{ config.title|default(config.defaultTitle) }}</h2>
	{% if reviews %}
	<ul>
	  {% for review in reviews %}
	  {% set author = review.User|default(null) %}
	  {% set course = review.course|default(null) %}
	  {% if author and course %}
	<li>
		 <a href="{{ path('user_show', {id:author.id}) }}">
			<img class="img-circle pull-left" src="{{ file_path(author.smallAvatar, 'avatar.png') }}">
		  </a>
			  <a class="com-author-link" href="{{ path('user_show', {id:author.id}) }}">{{ author.nickname }}:</a>
			  {{ review.content|plain_text(50) }}
	
		<p><a href="{{ path('course_show', {id:course.id}) }}"> {{ course.title|plain_text(9) }}</a><span class="pull-right stars-{{review.rating }}"></span></p>
		 
	</li>
	{% endif %}
	{% endfor %}
	{% else %}
	  <li class="empty">还没有评价</li>
	{% endif %}
	</ul>
</div>
